package com.pandora.templating;

import java.util.Vector;

import com.pandora.model.MultipleParameter;
import com.pandora.model.ParameterTable;
import com.pandora.model.SingleParameter;

public class MultipleParameterTemplate extends ParameterTemplate<MultipleParameter> {

	private Vector<ParameterTemplateTable<SingleParameter,SingleParameterTemplate>> parameterTables;
	
	public Vector<ParameterTemplateTable<SingleParameter,SingleParameterTemplate>> getParameterTables() {
		return parameterTables;
	}

	public void setParameterTables(Vector<ParameterTemplateTable<SingleParameter,SingleParameterTemplate>> parameterTables) {
		this.parameterTables = parameterTables;
	}

	@Override
	protected MultipleParameter createInstance() {
		Vector<ParameterTable<SingleParameter>> parameterTables = new Vector<ParameterTable<SingleParameter>>();
		for (ParameterTemplateTable<SingleParameter,SingleParameterTemplate> table : this.parameterTables) {
			ParameterTable<SingleParameter> p = table.getInstance();
			parameterTables.add(p);
		}
		return new MultipleParameter(super.getName(), parameterTables);
	}

}
